package io;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

public class wirteStringDemo {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos = new FileOutputStream("fo1.txt",true);

        String line = "给时光以生命，给岁月以文明";
         line = "222222";
        byte[] data = line.getBytes(StandardCharsets.UTF_8);

        fos.write(data);

        System.out.println("写入完毕");

        fos.close();


    }
}
